package behavioralPattern.visitor.example01.product;

import behavioralPattern.visitor.example01.Acceptable;
import behavioralPattern.visitor.example01.visitor.Visitor;
import lombok.Data;

import java.time.LocalDate;

@Data
public class Fruit extends Product implements Acceptable {

    private double weight; // 重量

    public Fruit(String name, LocalDate date, double price, double weight) {
        super(name, date, price);
        this.weight = weight;
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }
}
